#pragma once
#include "Object.h"
#include "../Game/Level.h"

class cBullet : public cObject
{
 private:
  int miOrientation;
  unsigned muiEnergy;
  int meOwner;
  std::string msTextureName;
 public:
  cBullet(unsigned int luiPosX = 0,
	 unsigned int luiPosY = 0,
	 unsigned int luiOrientation = eO_Over,
   std::string lsTextureName = "Bulletblue.png",
   int leOwner = ePlayer,
	 unsigned int luiEnergy = 0)
    {
      msTextureName = lsTextureName;
      miOrientation = luiOrientation;
      int liDirX = 0, liDirY = 0;
       switch (miOrientation)
        {
          case eO_North:
            liDirX = 0;
            liDirY = -1;
          break;
          case eO_South:
            liDirX = 0;
            liDirY = 1;
          break;
          case eO_West:
            liDirX = -1;
            liDirY = 0;
          break;
          case eO_East:
            liDirX = 1;
            liDirY = 0;
          break;
          case eO_NorthEast:
            liDirX = 1;
            liDirY = -1;
          break;
          case eO_NorthWest:
            liDirX = -1;
            liDirY =  -1;
          break;
          case eO_SouthEast:
            liDirX = 1;
            liDirY = 1;
          break;
          case eO_SouthWest:
            liDirX = -1;
            liDirY = 1;
          break;
      }

      muiX = luiPosX + liDirX;
      muiY = luiPosY + liDirY;

      meOwner = leOwner;
      muiEnergy = luiEnergy;
      muiCurrentFrame=0;
    }
  void Update( float lfTimeStep);
  void Render();
};
